package com.woniu.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//控制器注解-相当于@Component
@Controller
public class HelloController {

    @ResponseBody  //响应体注解 相当于response.getWriter().printin("Hello SpringBoot!!!”);
    @RequestMapping("/hello")
    public String sayHello(){
        System.out.println("sayHello");
        return "Hello World!";  //返回消息到客户端 默认会去请求转发的方式跳转至”返回值页面
    }
}
